package com.interpreter.common;

import java.math.BigDecimal;

/**
 * @author zhengwei
 * @date 2021-03-16
 */
public class Token {

  public String tokenType;
  public Object value;

  public Token(String tokenType, Object value) {
    this.tokenType = tokenType;
    this.value = value;
  }

  public static Token EofToken() {
    return new Token(Constant.TOKEN_EOF, null);
  }

  @Override
  public String toString() {
    if (this.value == null) {
      return "Token<" +  tokenType + ", null>";
    } else {
      return "Token<" +  tokenType + "," + value + ">";
    }
  }
}
